<!doctype html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<div id="app">
   <template v-if="'username'==loginType">
       <label>Username:</label>
       <input type="text" placeholder="Enter your username">
   </template>
    <template v-else>
        <label>Email:</label>
        <input type="text" placeholder="Enter your email">
    </template>
    <button @click="toggle">Toggle</button>
</div>
</body>
<script src="../../vender/vue@2.4.2.js"></script>
<script>

    var app=new Vue({
        el:'#app',
        data:{
            loginType:'username'
        },
        methods:{
            toggle:function(){
                this.loginType= 'email'==this.loginType?'username':'email';
            }
        }
    });

</script>
</html>